package compare;

import java.io.Serializable;
import java.util.Comparator;

/**
 * @Author Klys
 * @Date 2022/6/20
 * @Description
 * @Version 1.0
 */
public class CompareDemo implements Comparator<String>, Serializable {

    @Override
    public int compare(String o1, String o2) {
        return o1.compareTo(o2);
    }

    public static void main(String[] args) {
        String s1 = "cb";
        String s2 = "c";
        CompareDemo compareDemo = new CompareDemo();
        int compare = compareDemo.compare(s1, s2);
        System.out.println(compare);

        char c1 = 'a';
        char c2 = 'c';
        System.out.println(c1 - c2);

        char charAt = s1.charAt(0);
        System.out.println(charAt);
    }
}
